import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 28779
 * Date: 2023-08-22
 * Time: 11:26
 */
public class Demo1 {
    public volatile static int isQuite = 0;
    public static void main(String[] args) {
        Thread t1 = new Thread(() -> {
           while (isQuite == 0) {
               ;
           }
            System.out.println("程序t1执行结束");
        });

        Thread t2 = new Thread(() -> {
            Scanner scanner = new Scanner(System.in);
            isQuite = scanner.nextInt();
        });

        t1.start();
        t2.start();
    }
}
